package com.njust.controller;


import com.njust.bean.Teacher;
import com.njust.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class TeacherController {

    @Autowired
    private TeacherService teacherService;

    @RequestMapping("/getTeacher")
    @ResponseBody
    public Teacher getTeacher(@RequestParam(value = "id", defaultValue = "1") Integer id){
        Teacher teacher = teacherService.getEmployeeById(id);
        return teacher;
    }
}
